<?php

require_once(PATH_t3lib . 'class.t3lib_pagetree.php');
require_once(PATH_tslib.'class.tslib_pibase.php');
require_once(t3lib_extMgm::extPath('ratings', 'class.tx_ratings_api.php'));

/**
 * Plugin 'FE news display function' for the 'mt_fenews' extension.
 *
 * @author	Grzegorz Bańka <grzegorz.banka@gmail.com>
 * @package	TYPO3
 * @subpackage	tx_mtfenews
 */
class tx_mtfenews_pi3 extends tslib_pibase {
	var $prefixId      = 'tx_mtfenews_pi3';		// Same as class name
	var $scriptRelPath = 'pi3/class.tx_mtfenews_pi3.php';	// Path to this script relative to the extension dir.
	var $extKey        = 'mt_fenews';	// The extension key.
	var $pi_checkCHash = true;
	
	/**
	 * The main method of the PlugIn
	 *
	 * @param	string		$content: The PlugIn content
	 * @param	array		$conf: The PlugIn configuration
	 * @return	The content that is displayed on the website
	 */
	function main($content, $conf) {
		$this->conf = $conf;
		$this->pi_setPiVarDefaults();
		$this->pi_loadLL();
		$this->pi_initPIflexForm();		// Init FlexForm configuration for plugin
		$this->error=0;
		$this->imgupload='uploads/pics/';
		
//pid_recursive=1
//pid_depth=1
		
		
		$flexformTyposcript = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'myTS','lista');
		$this->ts_parse($flexformTyposcript);
		
		if($this->conf['pid']!='' && $this->conf['pid_recursive']!='' && $this->conf['pid_depth']!='') 
		{
			if(stristr($this->conf['pid'],',')) $pid=explode(',',$this->conf['pid']);
			else $pid=array($this->conf['pid']);
			for($i=0; $i<count($pid); $i++)
			{
				$pid=array_merge($pid,$this->get_treeID($pid[$i],$this->conf['pid_depth']));
				$this->conf['pid']=$this->get_treeID($treeStartingPoint,$depth);
			}
			$this->conf['pid']=implode(',',$pid);
		}
		//print_r($this->conf['pid']);
		//print_r($this->conf);
		
		$what_to_display=$this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'what_to_display', 'sDEF');
		
		$iconf['category']='';
		$iconf['template_file']=$this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'template_file', 'sDEF');		
		$iconf['for_editor_use']=intval($this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'use', 'for_editor'));
		$iconf['func_category']=intval($this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'func_category', 'lista'));
		$iconf['category_and_or']=intval($this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'category_and_or', 'lista'));
		
		$category=$this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'add_category', 'lista');
		if($category!='') $iconf['category']=stristr($category,',')?explode(',',$category):array($category);

		$iconf['return_user_uid']=$this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'return_user_uid', 'lista');
		$iconf['return_uid_user_pid']=$this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'return_uid_user_pid', 'lista');
		
		//print_r($for_editor_use);
	
		$this->conf['user.']['url']=$iconf['return_user_uid!']=''?$iconf['return_user_uid']:$this->conf['user.']['url'];
		$this->conf['user.']['pid']=$iconf['return_uid_user_pid']!=''?$iconf['return_uid_user_pid']:$this->conf['user.']['pid'];
		
		$iconf['add_fe_uid']=intval($this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'add_fe_uid', 'lista'));
		$iconf['add_return_user_uid']=$this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'add_return_user_uid', 'lista');
		
		//print_r($for_editor_use);

		$this->conf['user.']['add_tt_news_url']=$iconf['add_fe_uid']!=''?$iconf['add_fe_uid']:$this->conf['user.']['add_tt_news_url'];
		$this->conf['user.']['tt_news_url']=$add_return_user_uid!=''?$iconf['add_return_user_uid']:$this->conf['user.']['tt_news_url'];

		switch($what_to_display)
		{
			case 'LISTA':		
				//Lista settings
				$this->config=$this->conf['lista.'];
				$iconf['list_for_login']=intval($this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'is_for_login', 'lista'));
				$iconf['list_news_count']=intval($this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'news_count', 'lista'));
				
				$iconf['list_get_user_uid_from']=$this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'get_user_uid_from', 'lista');
				$iconf['list_news_single_view']=$this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'news_single_view', 'lista');				
				if($iconf['list_news_single_view']=='') $iconf['list_news_single_view'] = $this->conf['lista.']['news_single_view'];
				if($iconf['list_news_count']=='') $iconf['list_news_count']=$this->conf['lista.']['list_news_count'];

				$list_order=$this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'order', 'lista');
				$list_order_like=$this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'order_like', 'lista');

				$group_by=$order_by=$list_order;
				if($order_by!='') $order_by=$order_by.' '.$list_order_like;
				
				$content=$this->show_lista($iconf,$group_by,$order_by);
				
			break;
		}
	
		return $this->pi_wrapInBaseClass($content);
	}
	function get_treeID($treeStartingPoint,$depth)
	{
		$treeStartingRecord = t3lib_BEfunc::getRecord('pages', $treeStartingPoint);
		$tree = t3lib_div::makeInstance('t3lib_pageTree');
		$tree->init('AND ' . 1);
		$tree->getTree($treeStartingPoint, $depth, '');
		return $tree->ids;
	}	
	function ts_parse($flexformTyposcript)
	{
		if ($flexformTyposcript) {
			require_once(PATH_t3lib.'class.t3lib_tsparser.php');
			$tsparser = t3lib_div::makeInstance('t3lib_tsparser');
			// Copy conf into existing setup
			$tsparser->setup = $this->conf;
			// Parse the new Typoscript
			$tsparser->parse($flexformTyposcript);
			// Copy the resulting setup back into conf
			$this->conf = $tsparser->setup;
		}
	}
	function show_lista($iconf,$group_by,$order_by)
	{
		if($iconf['template_file']=='') $iconf['template_file']=$this->conf['template_file'];
		$templateCode =  $this->cObj->fileResource($iconf['template_file']);	
		$template['template'] = $this->cObj->getSubpart($templateCode,'###LIST###');
		$template['content'] = $this->cObj->getSubpart($template['template'],'###CONTENT###');	
		$template['empty'] = $this->cObj->getSubpart($template['template'],'###EMPTY###');	
		$subpartArray['###EMPTY###']='';
	
		if($iconf['list_for_login']==1) $user=intval($GLOBALS["TSFE"]->fe_user->user['uid']);
		else 
		{
			$uid_form=explode('|',$iconf['list_get_user_uid_from']);
			$user=$_GET[$uid_form[0]];
			$user=$user[$uid_form[1]];
			
		}
		if($this->conf['user_from_news']==1) 
		{
			$where = 'deleted=0 AND hidden=0 AND uid='.intval($_GET['tx_ttnews']['tt_news']);
			$res =  $GLOBALS['TYPO3_DB']->exec_SELECTquery('tx_mtfenews_user','tt_news',$where);
	
			while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))
			{
				$user=$row['tx_mtfenews_user'];
			}
		}
		$user_list=$user;
		list($markerArray,$subpartArray['###CONTENT###']) = $this->show_news($template['content'],$iconf,$user_list,$group_by,$order_by);
		$markerArray['###LINK_STUFF###']=$this->get_link_stuff($user_list);
		if($subpartArray['###CONTENT###']=='') 
		{
			$markerArray['###MS_TEXT###']=$this->conf['empty_list'];
			$subpartArray['###CONTENT###']=$this->cObj->substituteMarkerArrayCached($template['empty'], $markerArray);		
		}
		return $this->cObj->substituteMarkerArrayCached($template['template'],$markerArray,$subpartArray);
	}
	
	function access_cat($news,$option,$category,$category_and_or)
	{
	
		$count=$val=0;
		$where = 'uid_local='.$news.' AND uid_foreign IN('.implode(',',$category).')';
		$res =  $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid_local','tt_news_cat_mm',$where);

		while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))
		{	
			$val=1;
			$count++;
		}


		if($option==0 && $category_and_or==0 && $count==count($category)) return true;
		if($option==0 && $category_and_or==1 && $val==1) return true;
		if($option==1 && $category_and_or==0 && $count<count($category)) return true;
		if($option==1 && $category_and_or==1 && $val==0) return true;
		return false;
	}
	
	function show_news($template,$iconf,$user_list,$group_by,$order_by)
	{	
		$return=array();
		$ilosc=0;
		$group_by='uid';;

		if($this->conf['get_cat_from_news']==1 && isset($_GET['tx_ttnews']['tt_news'])) 
		{
			$where = 'uid_local='.intval($_GET['tx_ttnews']['tt_news']);
			$res =  $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid_foreign','tt_news_cat_mm',$where,'sorting ASC');
			while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))
			{
				$cat=$row['uid_foreign'];
			}
		}else $cat=intval($_GET['tx_ttnews']['cat']);
		
			if($this->conf['pid']!='') $add_where = ' AND pid IN('.$this->conf['pid'].')';
			if($this->conf['show_only_news']!='') 
			{
				$where='uid IN('.addslashes($this->conf['show_only_news']).') AND ';
				if($this->conf['show_for_all']==1) $where .= 'deleted=0 AND hidden=0';
				else $where .= 'deleted=0 AND hidden=0 AND tx_mtfenews_user='.$user_list;
				
			}
			elseif($this->conf['show_all_user']==1) $where = 'deleted=0 AND hidden=0';
			else $where = 'deleted=0 AND hidden=0 AND tx_mtfenews_user='.$user_list;	
			$where=$where.$add_where;

			if($this->conf['get_cat_from_news']==1 && isset($_GET['tx_ttnews']['tt_news']))
			{
						
			//tt_news.pid = 2 and tt_news.uid = tt_news_cat_mm.uid_local and tt_news_cat_mm.uid_foreign = {GPvar:tx_ttnews|cat} 
				$where='tt_news.pid='.$this->conf['pid'].' AND  tt_news.uid = tt_news_cat_mm.uid_local AND tt_news_cat_mm.uid_foreign ='.$cat.' AND tt_news.uid!='.intval($_GET['tx_ttnews']['tt_news']);
				$res =  $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid','tt_news tt_news, tt_news_cat_mm tt_news_cat_mm',$where,$group_by,$order_by);
				
			}
			elseif($this->conf['get_cat_from_news']==1)
			{
				$where='tt_news.pid='.$this->conf['pid'].' AND tt_news.uid = tt_news_cat_mm.uid_local AND tt_news_cat_mm.uid_foreign ='.$cat.' AND tt_news.tx_mtfenews_user='.$user_list;
				$res =  $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid','tt_news tt_news, tt_news_cat_mm tt_news_cat_mm',$where,$group_by,$order_by);
			}else $res =  $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid','tt_news',$where,$group_by,$order_by);
			
			while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))
			{				
				if($this->access_cat($row['uid'],$iconf['func_category'],$iconf['category'],$iconf['category_and_or']) || $iconf['category']=='')
				{
					$ilosc++;
					$work_uid[]=$row['uid'];
				}
			}

		$this->internal['res_count']=$ilosc;
		if(isset($this->piVars['pointer'])) $nr_wyswietlania=intval($this->piVars['pointer'])*$iconf['list_news_count'];
		else $nr_wyswietlania=0;
		$nr_list=$ilosc-$nr_wyswietlania;
		if($nr_list<$iconf['list_news_count']) $nr_list=$nr_list+$nr_wyswietlania;
		else $nr_list=$nr_wyswietlania+$iconf['list_news_count'];
		$this->conf['pageSize']=$nr_list;
		if(isset($this->piVars[$this->conf['page_browser_parameter']])) $nr_wyswietlania=intval($this->piVars[$this->conf['page_browser_parameter']])*$nr_list;

		$where = 'deleted=0 AND hidden=0 AND uid IN('.implode(',',$work_uid).') AND pid IN('.$this->conf['pid'].')';
		
		$res =  $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,crdate,title,image,imagealttext,imagetitletext,imagecaption,short,bodytext,tx_ttnewsyoutube_youtubevideo,tx_mtfenews_user','tt_news',$where,$group_by,$order_by,$nr_wyswietlania.','.$nr_list);

		while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))
		{
			$value='';
			unset($markerArray);
			$markerArray=array(
			'###NEWS_DATE###'			=>	date($this->config['date'],$row['crdate']),
			'###NEWS_TITLE###'			=>	$row['title'],
			'###NEWS_LINK###'			=>	$this->get_link($row['title'],$iconf['list_news_single_view'],$row['uid'],$iconf['for_editor_use'],$user_list),
			'###NEWS_IMAGE###'			=>	$this->get_image($row['image'],$row['imagealttext'],$row['imagetitletext'],$row['imagecaption']),
			'###NEWS_SUBHEADER###'		=>	$this->get_text($row['short'],$row['bodytext']),
			//'###LAST_CAT###'			=>	$this->get_cat($row['uid'],'last')
			);

			
			//print_r($user_list);
			list($markerArray['###FE_USER###'],$markerArray['###LINK_FE_USER###'])=$this->get_feuser($row['tx_mtfenews_user']);
			/* Minni youtube */
			
			if(stristr($row['tx_ttnewsyoutube_youtubevideo'],'watch#!v='))
			{
				list(,$value)=explode('watch#!v=',$row['tx_ttnewsyoutube_youtubevideo']);
				if(strstr($value,'&')) list($value)=explode('&',$value);
	
			}
			else 
			{
				if(stristr($row['tx_ttnewsyoutube_youtubevideo'],'watch?v='))
				{
					list(,$value)=explode('watch?v=',$row['tx_ttnewsyoutube_youtubevideo']);
					if(strstr($value,'&')) list($value)=explode('&',$value);
				
				}			
			}
			if($value!='') $markerArray["###YOUTUBE_CLASS###"]=$this->conf['youtube_class'];
			else $markerArray["###YOUTUBE_CLASS###"]='';
			if(strstr($value,'?')) list($value)=explode('?',$value);
			$markerArray["###MINI_YOUTUBEVIDEO###"] = 'http://i2.ytimg.com/vi/'.$value.'/default.jpg';
			if($markerArray["###MINI_YOUTUBEVIDEO###"]!='' && $markerArray['###NEWS_IMAGE###']=='') 
			if($value!='') $markerArray['###NEWS_IMAGE###']='<img src="'.$markerArray["###MINI_YOUTUBEVIDEO###"].'" width="'.$this->conf['image.']['file']['width'].'" height="'.$this->conf['image.']['file']['height'].'" />';	
			
			/* Rating  */
			$apiObj = t3lib_div::makeInstance('tx_ratings_api');
			$conf = $apiObj->getDefaultConfig();
			$conf['includeLibs'] = 'EXT:ratings/pi1/class.tx_ratings_pi1.php';
			$conf['ref'] = 'tt_news_' . $row['uid'];

			$cObj = t3lib_div::makeInstance('tslib_cObj');
			/* @var $cObj tslib_cObj */
			$cObj->start(array());

			$cObj = t3lib_div::makeInstance('tslib_cObj');
			/* @var $cObj tslib_cObj */
			$cObj->start(array());
			$conf['mode'] = 'static';
			$markerArray['###TX_RATINGS_STATIC###'] = $cObj->cObjGetSingle('USER_INT', $conf);


			$return[]=$this->cObj->substituteMarkerArrayCached($template,$markerArray);
		}

		if(isset($this->piVars['pointer'])) $nr_wyswietlania=intval($this->piVars['pointer'])*$iconf['list_news_count'];
		else $nr_wyswietlania=0;

		if($ilosc>0)
		{

			$this->internal['res_count']=$ilosc;
			$this->internal['showFirstLast']=$this->internal['dontLinkActivePage']=1;
			$this->internal['results_at_a_time'] = $iconf['list_news_count'];
			$this->internal['maxPages'] =$this->config['maxPages'];		
			
			$subpartArray['###BROWSERESULTS###'] = $this->pi_list_browseresults(
			   $showResultCount=1,
			   $tableParams='tx_mtfenews_usernews_related',
			   $wrapArr=$this->config['page_browser.'],
			   $pointerName='pointer',
			   $hscText=TRUE
			);
			
			if($this->conf['browser']==1) $subpartArray['###BROWSERESULTS###'] = $this->getListGetPageBrowser($ilosc);
			else $subpartArray['###BROWSERESULTS###'] ='';
			}else $subpartArray['###BROWSERESULTS###'] ='';

		return array($subpartArray,implode("\n",$return));
	}
	function get_link_stuff($user)
	{
		$add_params=str_replace('$feuser',$user,$this->conf['link_stuff_params']);
		$link = $this->get_cat(intval($_GET['tx_ttnews']['tt_news']),'last',$this->conf['link_stuff_title'],$add_params);
		return $link;
	}
	function get_cat($uid,$option,$title='',$add_params='')
	{
		if($option=='last') $sort='sorting ASC';
		$where = 'uid_local='.$uid;
		$res =  $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid_foreign','tt_news_cat_mm',$where,'',$sort);
		while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))
		{
			$cat=$row['uid_foreign'];
		}
		$where = 'deleted=0 AND hidden=0 AND uid='.$cat;
		$res =  $GLOBALS['TYPO3_DB']->exec_SELECTquery('title','tt_news_cat',$where);
		while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))
		{
			if($title=='') $title=$row['title'];
		}
		$array_param = array(
		'useCacheHash' => 1,
		'parameter' => $this->conf['cat_pid'].' _self',
		'additionalParams' => '&tx_ttnews[cat]='.$cat.$add_params
		);	
		return $this->cObj->typolink($title,$array_param);
	}
	protected function getListGetPageBrowser($numberOfPages) {
		// Get default configuration
		$conf = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_pagebrowse_pi1.'];
		//$conf['extraQueryString']='&tt_content=';
		
		// Modify this configuration
		$conf += array(
			'pageParameterName' => $this->prefixId . '|'.$this->conf['page_browser_parameter'],
			'numberOfPages' => intval($numberOfPages/$this->conf['pageSize']) +
				(($numberOfPages % $this->conf['pageSize']) == 0 ? 0 : 1),
		);
		
		// Get page browser
		$cObj = t3lib_div::makeInstance('tslib_cObj');
		/* @var $cObj tslib_cObj */
		$cObj->start(array(), '');
		return $cObj->cObjGetSingle('USER', $conf);
	}
	
	function get_feuser($uid)
	{
		$fe_url=str_replace('|',$uid,$this->conf['user.']['url']);
		
		$return=array(0=>'',1=>'');
		$where = 'disable=0 AND uid='.$uid;
		$res =  $GLOBALS['TYPO3_DB']->exec_SELECTquery('username','fe_users',$where);

		while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))
		{
			$return[0]=$row['username'];
			$array_param = array(
			'useCacheHash' => 1,
			'parameter' => $this->conf['user.']['pid'].' _self',
			'additionalParams' => '&'.$fe_url,
			'returnLast'=>'url'
			);	
			$return[1] = $this->cObj->typolink('',$array_param);
		}
		return $return;	
	}
	function get_cat_pid($uid,$single_pid)
	{
		$where = 'uid_local='.$uid;
		$res =  $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid_foreign','tt_news_cat_mm',$where,'','sorting',1);

		while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))
		{
			$uid_foreign=$row['uid_foreign'];
		}
		if($uid_foreign>0)
		{
			$where = 'deleted=0 AND hidden=0 AND uid='.$uid_foreign;
			$res =  $GLOBALS['TYPO3_DB']->exec_SELECTquery('single_pid','tt_news_cat',$where,'','sorting');
	
			while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))
			{
				$single_pid=$row['single_pid']?$row['single_pid']:$single_pid;
			}
		}
		return $single_pid;
	}
	function get_link($title,$news_single_view,$uid,$for_editor_use,$user)
	{
		if($this->conf['useSPidFromCategory']==1) $news_single_view=$this->get_cat_pid($uid,$news_single_view); 	
		$add_param='&tx_ttnews[tt_news]='.$uid;
		if($this->conf['user.']['add_tt_news_url']==1) $add_param.='&'.str_replace('|',$user,$this->conf['user.']['tt_news_url']);
		
		if($for_editor_use==1) $add_param.='&tx_mtfenews_pi1[edit]='.$uid;
		$array_param = array(
		'useCacheHash' => 1,
		'parameter' => $news_single_view.' _self',
		'returnLast'	=>	'url',
		'additionalParams' => $add_param,
		);	

		return $this->cObj->typolink('',$array_param);
	}
	function get_text($short,$bodytext)
	{
		if($short!='' && strlen($short)>=$this->config['subheader.']['minlen']) $text=substr($short,0,$this->config['subheader.']['maxlen']);
		elseif($text!='' && strlen($text)>=$this->config['subheader.']['minlen']) $text=substr($bodytext,0,$this->config['subheader.']['maxlen']);
		else  $text=substr($short,0,$this->config['subheader.']['maxlen']);		
		$text=str_replace('|',$text,$this->config['subheader.']['wrap']);
		return $text;
	}
	function get_image($image,$alt,$title,$desc)
	{
		if(stristr($image,',')) list($image)=explode(',',$image);
		$img = $this->config['image.'];
		if($alt!='') $img['altText']=$alt;
		if($title!='') $img['titleText']=$title;
		$img['file'] = $this->imgupload.$image;
		if(strlen($desc)>5 && $this->conf['image_show_desc']==1) $add='<p>'.$desc.'</p>';		

		return $this->cObj->IMAGE($img).$add;
	}
	function get_news($list_news_count,$list_get_user_uid_from,$list_for_login)
	{
		$return_user=$return_news=array();
		
		if($list_for_login==1) $user=intval($GLOBALS["TSFE"]->fe_user->user['uid']);
		else 
		{
			$uid_form=explode('|',$list_get_user_uid_from);
			$user=$_GET[$uid_form[0]];
			$user=$user[$uid_form[1]];
		}

		if($user!=0)
		{
			if($this->conf['pid']!='') $add_where = ' AND pid IN('.$this->conf['pid'].')';
			
			$where = 'deleted=0 AND hidden=0 AND user='.$user.$add_where;
			$res =  $GLOBALS['TYPO3_DB']->exec_SELECTquery('news,user','tx_mtfenews_usernews_related',$where,'uid','uid',99);
	
			while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))
			{
				$return_news[]=$row['news'];
				$return_user[$row['news']]=$row['user'];
			}
		}
		else $this->error=1;

		return array($return_news,$return_user);
	}
}



if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/mt_fenews/pi3/class.tx_mtfenews_pi3.php'])	{
	include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/mt_fenews/pi3/class.tx_mtfenews_pi3.php']);
}

?>